Skip to content

Treat rich text editor newlines as line breaks, not paragraph breaks#10293

Open
alokedesai wants to merge 8 commits into
masterfrom
aloke/code_review_comment_styling
Open

Treat rich text editor newlines as line breaks, not paragraph breaks#10293
alokedesai wants to merge 8 commits into
masterfrom
aloke/code_review_comment_styling

Conversation

@alokedesai
Copy link
Copy Markdown
Member

@alokedesai alokedesai commented May 6, 2026

Description

The rich text editor would treat each newline as a paragraph break instead of line break causing the user-visible line height to look unusually large.

image

This PR changes the styling of the rich text editor to more closely mimic a normal markdown editor instead of an editor like Notion.

Specifically:

  1. I changed the margin of text blocks to be 0px. There's now no difference in padding between hard-wrapped and soft-wrapped lines.
  2. I reduced the padding of some of the other block styles (including headers)
  3. I removed the post_process notebook step that strips newlines. This processing step was just wrong, we should use the filesystem as the source of truth and it would remove multiple newlines between content (foo\n\n\n\nbar would become foo\nbar).

Testing

I did a bunch of monkey testing with AI-generated markdown. See screenshots and looms below

…tory

- Add RichTextStylesExt trait with new_with_default_line_height for comment editors
- Add IndentableBlockSpacing::new() and BlockSpacings::uniform() constructors
- Add style_factory field to RichTextEditorConfig/RichTextEditorView
- Consolidate style_factory with initial styles in comment_editor
- Compact text block spacings, 3px cursor width, remove minimum_paragraph_height

Co-Authored-By: Oz <oz-agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label May 6, 2026
@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented May 6, 2026

@alokedesai

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Copy link
Copy Markdown
Member Author

alokedesai commented May 6, 2026

Copy link
Copy Markdown
Contributor

@oz-for-oss oz-for-oss Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds custom rich text styling for code review comment editors, wires a style factory through RichTextEditorView so styles rebuild correctly after appearance/font changes, and adds related editor keybindings.

Concerns

  • No blocking correctness or security concerns found.
  • Two comment typos were introduced in touched code.

Verdict

Found: 0 critical, 0 important, 2 suggestions

Approve with nits

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

Comment thread app/src/notebooks/editor/view.rs Outdated
EditableBinding::new(
// This doesn't reuse the move_to_line_start naming from the terminal input editor to
// distinguish between soft-wrapped line and hard-wrapped line (paragraph) movement.
// distinguish between soft-wrappped line and hard-wrapped line (paragraph) movement.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 [NIT] Fix the typo in this comment.

Suggested change
// distinguish between soft-wrappped line and hard-wrapped line (paragraph) movement.
// distinguish between soft-wrapped line and hard-wrapped line (paragraph) movement.

Comment thread app/src/notebooks/editor/view.rs Outdated
}

// Represents the states of an ongoing mouse event. Note that these states are mutually exclusive:
// Represents the states of an ongoing mouse event. Note that these states are mutally exclusive:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 [NIT] Fix the typo in this comment.

Suggested change
// Represents the states of an ongoing mouse event. Note that these states are mutally exclusive:
// Represents the states of an ongoing mouse event. Note that these states are mutually exclusive:

@alokedesai alokedesai changed the title Comment editor styling: line height, spacing, cursor width, style_factory Treat rich text editor newlines as line breaks, not paragraph breaks May 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant